#include <iostream>
#include <math.h>
using namespace std;

bool isPrime(long long int p){
    if(p<=3)
        return p > 1;
    else if(p%2 == 0 || p%3 == 0)
        return false;
    else{
        for(long long int i = 5; i*i<=p; i+=6){
            if(p%i==0||p%(i+2)==0)
                return false;
        }
        return true;
    }
}

int main()
{
    long long int sum = 0;
    long long int maxi = 2000000;
    for(long long int i = 2; i < maxi; i++){
        if(isPrime(i)){
            sum += i;
            cout << "Prime: " << i << "\t Sum: " << sum << endl;
        }
    }
    cout << "Sum: " << sum << endl;
    return 0;
}
